Optimal. Leaf size=54 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {a+b}}+\frac {\tan (x)}{2 a \left ((a+b) \tan ^2(x)+a\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3191, 199, 205} \[ \frac {\tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {a+b}}+\frac {\tan (x)}{2 a \left ((a+b) \tan ^2(x)+a\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 199
Rule 205
Rule 3191
Rubi steps
\begin {align*} \int \frac {\cos ^2(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx &=\operatorname {Subst}\left (\int \frac {1}{\left (a+(a+b) x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=\frac {\tan (x)}{2 a \left (a+(a+b) \tan ^2(x)\right )}+\frac {\operatorname {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{2 a}\\ &=\frac {\tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {a+b}}+\frac {\tan (x)}{2 a \left (a+(a+b) \tan ^2(x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 59, normalized size = 1.09 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {a+b}}-\frac {\sin (2 x)}{2 a (-2 a+b \cos (2 x)-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.47, size = 313, normalized size = 5.80 \[ \left [\frac {4 \, {\left (a^{2} + a b\right )} \cos \relax (x) \sin \relax (x) + {\left (b \cos \relax (x)^{2} - a - b\right )} \sqrt {-a^{2} - a b} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \relax (x)^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \relax (x)^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \relax (x)^{3} - {\left (a + b\right )} \cos \relax (x)\right )} \sqrt {-a^{2} - a b} \sin \relax (x) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \relax (x)^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \relax (x)^{2} + a^{2} + 2 \, a b + b^{2}}\right )}{8 \, {\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2} - {\left (a^{3} b + a^{2} b^{2}\right )} \cos \relax (x)^{2}\right )}}, \frac {2 \, {\left (a^{2} + a b\right )} \cos \relax (x) \sin \relax (x) + {\left (b \cos \relax (x)^{2} - a - b\right )} \sqrt {a^{2} + a b} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \relax (x)^{2} - a - b}{2 \, \sqrt {a^{2} + a b} \cos \relax (x) \sin \relax (x)}\right )}{4 \, {\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2} - {\left (a^{3} b + a^{2} b^{2}\right )} \cos \relax (x)^{2}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 77, normalized size = 1.43 \[ \frac {\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \relax (x) + b \tan \relax (x)}{\sqrt {a^{2} + a b}}\right )}{2 \, \sqrt {a^{2} + a b} a} + \frac {\tan \relax (x)}{2 \, {\left (a \tan \relax (x)^{2} + b \tan \relax (x)^{2} + a\right )} a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.22, size = 51, normalized size = 0.94 \[ \frac {\tan \relax (x )}{2 a \left (\left (\tan ^{2}\relax (x )\right ) a +\left (\tan ^{2}\relax (x )\right ) b +a \right )}+\frac {\arctan \left (\frac {\left (a +b \right ) \tan \relax (x )}{\sqrt {a \left (a +b \right )}}\right )}{2 a \sqrt {a \left (a +b \right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.72, size = 49, normalized size = 0.91 \[ \frac {\tan \relax (x)}{2 \, {\left ({\left (a^{2} + a b\right )} \tan \relax (x)^{2} + a^{2}\right )}} + \frac {\arctan \left (\frac {{\left (a + b\right )} \tan \relax (x)}{\sqrt {{\left (a + b\right )} a}}\right )}{2 \, \sqrt {{\left (a + b\right )} a} a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 14.31, size = 50, normalized size = 0.93 \[ \frac {\mathrm {atan}\left (\frac {\mathrm {tan}\relax (x)\,\left (2\,a+2\,b\right )}{2\,\sqrt {a}\,\sqrt {a+b}}\right )}{2\,a^{3/2}\,\sqrt {a+b}}+\frac {\mathrm {tan}\relax (x)}{2\,a\,\left (\left (a+b\right )\,{\mathrm {tan}\relax (x)}^2+a\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________